package com.zzw.design.expression;

import java.util.Map;

/**
 * @author zzw
 * @see
 * @since 2018/3/26
 */
public class Variable implements Expression {

    private String name;

    public Variable(String name) {
        this.name = name;
    }

    @Override
    public int interpret(Map<String, Expression> variables) {
        if (null == variables.get(name)){
            return 0;
        }
        return variables.get(name).interpret(variables);
    }
}
